package LinkList;

public class Test {
    public static void main(String[] args) {
        Define define=new LinkList();
        test1(define);
        test2(define);
        test3(define);
        LinkList linkList=new LinkList();
        linkList.addLast(1);
        linkList.addLast(2);
        linkList.addLast(3);
        linkList.addLast(4);
        linkList.print(linkList.getIndex(0));    //递归逆序打印
    }
    public static void test1(Define define) {
        define.addLast(1);
        define.addFirst(2);
        define.addFirst(3);
        define.addFirst(4);
        define.addFirst(5);
        define.addLast(6);
        define.addIndex(6,10);
        define.display();
        define.display(define.get(4));
        define.display(define.getIndex(2));
    }
    public static void test2(Define define) {
        System.out.println(define.contains(5));
        System.out.println(define.size());
        define.addIndex(0,10);
        define.display();
        define.addFirst(10);
        define.addIndex(5,10);
        define.addIndex(6,10);
        define.addIndex(11,100);
        define.display();
        define.removeAll(10);
        define.remove(100);
        define.remove(2);
        define.remove(6);
        define.display();
    }
    public static void test3(Define define) {
        define.clear();
        define.display();
    }
}
